<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <h1>函数</h1>
    <script>
      /*
      function fn(sfz,m){
         return '卧铺一张'+m+"元";
      }
      let piao =  fn('400400404',150)
      console.log( piao );
      

      let s = [80,20,37,91,5,65,15];
      s.sort(function(a,b){ return b-a});
      //降序显示
      console.log( s );
      */

      // let a = ['德玛','temo','龙龟'];
      //a.push('1111');
      //a.unshift('2222');
      //let y =  a.pop();
      //let y = a.shift();

      // console.log( a );
      // console.log( '删除了谁？'+ y );

    // 54张牌 ，分给3人，每人17张， 底牌3 
      let a  = [1,2,3,4,5,6,7,8,9];
      // a.sort(()=>0.5-Math.random())
      function shuffle(b){
         for(i in b){
            let rndi = parseInt(b.length* Math.random());
            let k = b[i];
            b[i] = b[rndi];
            b[rndi] = k;
         }
      }
      //打乱
      shuffle(a);
      console.log( a );

    </script>
</body>
</html>